﻿using EnsureThat;

namespace Commons
{
	/// <summary>
	/// Represents an indicator of progress
	/// </summary>
	public class ProgressEventArgs
	{
		private int m_percent;

		/// <summary>
		/// The percent complete
		/// </summary>
		public int PercentComplete
		{
			get { return m_percent; }
		}

		private string m_message;

		/// <summary>
		/// The progress message
		/// </summary>
		public string Message
		{
			get { return m_message; }
		}

		/// <summary>
		/// Initializes this <see cref="ProgressEventArgs"/>
		/// </summary>
		/// <param name="percent">The percent complete</param>
		/// <param name="message">An optional message</param>
		public ProgressEventArgs(int percent, string message = "")
		{
			Ensure.That(percent, "percent").IsGte(0).IsLte(100);
			this.m_percent = percent;
			this.m_message = message;
		}
	}
}